﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.Text;
using System.Threading.Tasks;
using Windows.UI.Xaml.Media;
using Windows.UI.Xaml.Media.Imaging;

namespace CrmField.Win8App.Data
{
    public partial class ServiceAppointment
    {
        [DataMember]
        public ActivityDataGroup Group
        {
            get;
            set;
        }

        [DataMember]
        public bool IsDirty
        {
            get;
            set;
        }

        [IgnoreDataMember]
        public string TimeAndSubject
        {
            get
            {
                return string.Format("{0:HH:mm} {1}", this.ScheduledStart, this.Subject);
            }
        }

        private ImageSource _image = null;
        [IgnoreDataMember]
        public ImageSource Image
        {
            get
            {
                if (this._image == null)
                {
                    this._image = new BitmapImage(new Uri("ms-appx:///Assets/ItemLogoDefault.png"));
                }
                return this._image;
            }
        }

        [IgnoreDataMember]
        private bool _showScheduled;
        public bool ShowScheduled
        {
            get
            {
                return _showScheduled;
            }
            set
            {
                _showScheduled = value;
                OnPropertyChanged("ShowScheduled");
            }
        }
    }
}
